import Vue from 'vue';
import Router from 'vue-router';
import index from '@/views/index';
import scrmIndex from '@/views/index/index'//
import demo from '@/components/template'
import Code from '@/views/masket/code/employee'
import Friends from '@/views/masket/friendings/friending'//
import Red_envelope from '@/views/masket/red_envelope/first'
import Wheel from '@/views/masket/wheel/first'
import Offline from '@/views/masket/offline/index'
import Fission from '@/views/masket/fission/fission'
import Traceability from '@/views/masket/traceability/activity'

import ClientClue from '@/views/customer/client_clue/index'
import ClientSeas from '@/views/customer/client_seas/index'//
import ClientList from '@/views/customer/client_list/index'
import ClientStage from '@/views/customer/client_stage/index'
import ClientSop from '@/views/customer/client_sop/index'
import ClientMigration from '@/views/customer/client_migration/index'
import ClientMass from '@/views/customer/client_mass_text/index'
import ClientMoments from '@/views/customer/client_moments/index'
import ClientGreeting from '@/views/customer/client_greeting/index'
import ClientLoss from '@/views/customer/client_loss/index'
import ClientBlacklist from '@/views/customer/client_blacklist/index'

import CGmanage from '@/views/custGroup/manage/list'
import GroupTag from '@/views/custGroup/groupTag/list'
import Sop from '@/views/custGroup/sop/list'
import TagCreate from '@/views/custGroup/tagCreate/list'
import Unlimited from '@/views/custGroup/unlimited/list'
import Event from '@/views/custGroup/event/list'
import Welcome from '@/views/custGroup/welcome/list'
import BatchSend from '@/views/custGroup/batchSend/list'
import Statistics from '@/views/custGroup/statistics/list'
//内容引擎
import Promotion from '@/views/content/promotion/list'
import Conversation from '@/views/content/conversation/list'
import Answer from '@/views/content/answer/list'
import Article from '@/views/content/article/list'
import Material from '@/views/content/material/list'//
import Card from '@/views/content/card/list'
import Form from '@/views/content/form/list'//报错
import Program from '@/views/content/program/list'

//风控管理
import SessionArchive from '@/views/riskControl/session_archive/index'
import SessionContent from '@/views/riskControl/session_content/index'
import IllegalRemind from '@/views/riskControl/illegal_remind/index'
import DeleteRemind from '@/views/riskControl/delete_remind/index'
import CustomersRemind from '@/views/riskControl/customers_remind/index'
import GroupInspection from '@/views/riskControl/group_inspection/index'
import Censorship from '@/views/riskControl/censorship/index'

//数据安全
import WxFollowUp from '@/views/security/wxFollowUp/list'
import Generalize from '@/views/security/generalize/list'
import Transform from '@/views/security/transform/list'
import Analyze from '@/views/security/analyze/list'
import Content from '@/views/security/content/index'
import Target from '@/views/security/target/index'

// 启用路由
Vue.use(Router);

export const constantRoutes = [
    {
        path: '/',
        name: '首页',
        component: index,
        redirect: '/views/index',
        iconCls: 'el-icon-tickets',
        children: [
            {
                path: '/views/index',
                name: 'scrmIndex',
                component: scrmIndex,
            },
            {
                path: '/masket/code',
                name: 'employee',
                component: Code,
            },
            {
                path: '/masket/friends',
                name: 'friends',
                component: Friends,
            },
            {
                path: '/masket/red',
                name: 'red_envelope',
                component: Red_envelope,
            },
            {
                path: '/masket/wheel',
                name: 'wheel',
                component: Wheel,
            },
            {
                path: '/masket/offline',
                name: 'offline',
                component: Offline,
            },
            {
                path: '/masket/fission',
                name: 'fission',
                component: Fission,
            },
            {
                path: '/masket/traceability',
                name: 'traceability',
                component: Traceability,
            },
            {
                path: '/customer/clientClue',
                name: 'clientClue',
                component: ClientClue,
            },
            {
                path: '/customer/clientSeas',
                name: 'clientSeas',
                component: ClientSeas,
            },
            {
                path: '/customer/clientList',
                name: 'clientList',
                component: ClientList,
            },
            {
                path: '/customer/clientStage',
                name: 'clientStage',
                component: ClientStage,
            },
            {
                path: '/customer/clientSop',
                name: 'clientSop',
                component: ClientSop,
            },
            {
                path: '/customer/clientMigration',
                name: 'clientMigration',
                component: ClientMigration,
            },
            {
                path: '/customer/clientMass',
                name: 'clientMass',
                component: ClientMass,
            },
            {
                path: '/customer/clientMoments',
                name: 'clientMoments',
                component: ClientMoments,
            },
            {
                path: '/customer/clientGreeting',
                name: 'clientGreeting',
                component: ClientGreeting,
            },
            {
                path: '/customer/clientLoss',
                name: 'clientLoss',
                component: ClientLoss,
            },
            {
                path: '/customer/clientBlacklist',
                name: 'clientBlacklist',
                component: ClientBlacklist,
            },
            {
                path: '/custGroup/cGmanage',
                name: 'cGmanage',
                component: CGmanage,
            },
            {
                path: '/custGroup/groupTag',
                name: 'groupTag',
                component: GroupTag,
            },
            {
                path: '/custGroup/sop',
                name: 'sop',
                component: Sop,
            },
            {
                path: '/custGroup/tagCreate',
                name: 'tagCreate',
                component: TagCreate,
            },
            {
                path: '/custGroup/unlimited',
                name: 'unlimited',
                component: Unlimited,
            },
            {
                path: '/custGroup/event',
                name: 'event',
                component: Event,
            },
            {
                path: '/custGroup/welcome',
                name: 'welcome',
                component: Welcome,
            },
            {
                path: '/custGroup/batchSend',
                name: 'batchSend',
                component: BatchSend,
            },
            {
                path: '/custGroup/statistics',
                name: 'statistics',
                component: Statistics,
            },
            {
                path: '/content/promotion',
                name: 'promotion',
                component: Promotion,
            },
            {
                path: '/content/conversation',
                name: 'conversation',
                component: Conversation,
            },
            {
                path: '/content/answer',
                name: 'answer',
                component: Answer,
            },
            {
                path: '/content/article',
                name: 'article',
                component: Article,
            },
            {
                path: '/content/material',
                name: 'material',
                component: Material,
            },{
                path: '/content/card',
                name: 'card',
                component: Card,
            },
            {
                path: '/content/form',
                name: 'form',
                component: Form,
            },
            {
                path: '/content/Program',
                name: 'Program',
                component: Program,
            },

//风控管理
            {
                path: '/riskControl/sessionArchive',
                name: 'sessionArchive',
                component: SessionArchive,
            },
            {
                path: '/riskControl/sessionContent',
                name: 'sessionContent',
                component: SessionContent,
            },
            {
                path: '/riskControl/illegalRemind',
                name: 'illegalRemind',
                component: IllegalRemind,
            },
            {
                path: '/riskControl/deleteRemind',
                name: 'deleteRemind',
                component: DeleteRemind,
            },
            {
                path: '/riskControl/customersRemind',
                name: 'customersRemind',
                component: CustomersRemind,
            },
            {
                path: '/riskControl/groupInspection',
                name: 'groupInspection',
                component: GroupInspection,
            },
            {
                path: '/riskControl/censorship',
                name: 'censorship',
                component: Censorship,
            },
//数据安全
            {
                path: '/security/wxFollowUp',
                name: 'wxFollowUp',
                component: WxFollowUp,
            },
            {
                path: '/security/generalize',
                name: 'generalize',
                component: Generalize,
            },
            {
                path: '/security/transform',
                name: 'transform',
                component: Transform,
            },
            {
                path: '/security/analyze',
                name: 'analyze',
                component: Analyze,
            },
            {
                path: '/security/content',
                name: 'content',
                component: Content,
            },
            {
                path: '/security/target',
                name: 'target',
                component:Target,
            },
            
            
            
            
            
            
            
            
            
            
            
        ]
    },{
        path: '/demo',
        name: '案例',
        component: demo,
        iconCls: 'el-icon-tickets',
    }]

    const createRouter = () => new Router({
      // mode: 'history', // require service support
      scrollBehavior: () => ({ y: 0 }),
      routes: constantRoutes
    })
    
    const router = createRouter()
    
    // Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
    export function resetRouter() {
      const newRouter = createRouter()
      router.matcher = newRouter.matcher // reset router
    }
    
    export default router

